Imports RIBS.DataAccessLayer

Namespace BusinessLogicLayer
    Public Class History
        Public Shared Function InsertNewAction(ByVal RibsID As Int32, _
                                                ByVal Action As String, _
                                                ByVal Note As String, _
                                                ByVal ActionDate As Date, _
                                                ByVal ContactMethod As String, _
                                                ByVal Status As String, _
                                                ByVal Reason As String, _
                                                ByVal lUser As String) As Int32
            Try
                Dim DBLayer As New DataAccess
                Dim lNote As String = Replace(Note, "'", "''")
                lNote = Replace(lNote, """", "")
                Return DBLayer.InsertNewAction(RibsID, Action, lNote, ActionDate, ContactMethod, Status, Reason, lUser)
            Catch ex As Exception
                Throw ex
            End Try
            Return True
        End Function

        Public Shared Function AllocateItem(ByVal ribsID As Int32, ByVal UserID As String) As Int32
            Try
                Dim DBLayer As New DataAccess
                InsertNewAction(ribsID, "Allocated", "Allocated To: " & UserID, Now, "Other", "Allocated", "", UserID)
                DBLayer.AllocateItem(ribsID)
            Catch ex As Exception
                Throw ex
            End Try
        End Function
    End Class

End Namespace

